//
//  ViewController.m
//  SLKit
//
//  Created by S_LINE on 2020/6/21.
//  Copyright © 2020 S_LINE. All rights reserved.
//

#import "ViewController.h"

#import "SLKit.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    NSMutableArray *mutablearray = [NSMutableArray new];
    [mutablearray addObjectsFromArray:@[@"1", @"2", @"3"]];
    NSLog(@"%@", [mutablearray sl_objectAtIndex:1]);
    NSLog(@"%@", [mutablearray sl_objectAtIndex:10]);
    [mutablearray sl_insertObject:@"4" atIndex:4];
    NSLog(@"%@", mutablearray);
    [mutablearray sl_removeObjectAtIndex:3];
    NSLog(@"%@", mutablearray);
    [mutablearray sl_replaceObjectAtIndex:3 withObject:@"4"];
    NSLog(@"%@", mutablearray);
    [mutablearray sl_replaceObjectAtIndex:2 withObject:@"4"];
    NSLog(@"%@", mutablearray);
    mutablearray = [NSMutableArray new];
    [mutablearray sl_removeObjectAtIndex:0];
    
    NSMutableDictionary *dict = [NSMutableDictionary new];
    [dict setObject:@"1" forKey:@"1"];
    [dict setObject:@"2" forKey:@"2"];
    [dict setObject:@"3" forKey:@"3"];
    NSLog(@"%@", [dict sl_objectForKey:@"11"]);
    NSLog(@"%@", [dict sl_objectForKey:@"1"]);
    [dict removeObjectForKey:@"1"];
    NSLog(@"%@", dict);
    [dict sl_removeObjectForKey:@"2"];
    NSLog(@"%@", dict);
    [dict sl_setObject:@"2" forKey:@"2"];
    NSLog(@"%@", dict);
    [dict sl_setObject:nil forKey:@"2"];
    NSLog(@"%@", dict);
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    UIViewController *vc = [[NSClassFromString(@"SLDemoViewController") alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}

@end
